package com.yd.mvc.mobile.goodsTypeController;

import com.yd.app.service.mobile.goodsTypeService.MGoodsTypeService;
import com.yd.app.util.BusinessException;
import com.yd.domain.business.GTypeOne;
import com.yd.domain.business.PinXing;
import com.yd.mvc.baseController.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: zy
 * @Desc: 商品类型一级二级三级分类
 * @Date:  2018/4/28
 * @Param
 */
@RestController
@RequestMapping(value = "/dapi/mGoodType")
public class MGoodsTypeController extends BaseController{
    @Autowired
    private MGoodsTypeService mGoodsTypeService;

    /**
     * @Author: zy
     * @Desc: 查询商品导航三级
     * @Date:  2018/4/28
     * @Param
     */
    @RequestMapping(value = "/getGoodNav", method = RequestMethod.GET)
    public List<GTypeOne> getGoodNav() throws BusinessException {
        List<GTypeOne> list=mGoodsTypeService.getGoodNav();
        return list;
    }

    @RequestMapping(value = "/getPxByPid/{pId}", method = RequestMethod.GET)
    public List<PinXing> getPxByPid(@PathVariable("pId") String pId){
        List<PinXing> list= mGoodsTypeService.getPxByPid(pId);
        return list;
    }

}
